<section class="uppload">

<div class="well well-small">
   <h3>Upload</h3> 
</div>

<?php if ($this->error): ?>
<p class="p">There were one or more issues with your submission. Please correct them as indicated below. </p>
<?php endif ?>

<?php
$form = $this->form;
$form->prepare();
$form->setAttribute('action', $this->url(NULL,array('controller'=>'Upploadmanager', 'action' => 'add')));
$form->setAttribute('class', 'Form');
//$form->setAttribute('action', $this->url(NULL,array('controller'=>'Upploadmanager', 'action' => 'add')));
//$form->setAttribute('action', $this->view->url());
$form->setAttribute('method', 'post');
$form->setAttribute('enctype', 'multipart/form-data');
echo $this->form()->openTag($form);
?>

<dl class="dl">

  <dd><?php echo $this->formElement($form->get('id'));  ?></dd>
  <dd><?php echo $this->formElement($form->get('user_id'));  ?></dd>

  <dt><?php echo $this->formLabel($form->get('label')); ?></dt>
  <dd><?php echo $this->formElement($form->get('label')); echo $this->formElementErrors($form->get('label')); ?></dd>
  <dt><?php echo $this->formLabel($form->get('filename')); ?></dt>
  <dd><?php echo $this->formFile($form->get('filename')); echo $this->formElementErrors($form->get('filename')); ?></dd>

  
  <dt><?php //echo $this->formLabel($form->get('sharing')); ?></dt>
  <dd><?php echo $this->formElement($form->get('sharing')).' Make uploaded files shared?'; echo $this->formElementErrors($form->get('sharing')); ?></dd>
  <dt><?php echo $this->formLabel($form->get('users')); ?></dt>
  <dd><?php echo $this->formElement($form->get('users')); echo $this->formElementErrors($form->get('users')) ?></dd>
  
  <dd><?php echo $this->formElement($form->get('submit')); echo $this->formElementErrors($form->get('submit')); ?></dd>
</dl>

<?php echo $this->form()->closeTag() ?>
</section>

<!-- ****************************displaing sharing users************************************ -->

<?php 
$title_shared = 'Upload Sharing';
?>
<h3><?php echo $this->escapeHtml($title_shared);?></h3>

<table class="table">
 <tr>
     <th>Shared User</th>
     <th>File name</th>
     <th>Action</th>    
 </tr>
 <?php foreach ($this->sharedUsers as $sharedUser) : ?>
 <tr>
     <td><?php echo $this->escapeHtml($sharedUser->name);?></td>
     <td><?php echo $this->escapeHtml($sharedUser->filename);?></td>
     <td><a href="<?php echo $this->url('upploadmanager', array('action'=>'removeshare', 'id' => $sharedUser->id));?>">Delete</a></td>        
 </tr>
 <?php endforeach; ?>
</table>



